<template>
  <div>
    <!--站点概况-->
    <div class='site'>
      <div class='block'>
        <p>最大需量</p>
        <h2>{{ basicInfo.ele_a }}KW</h2>
      </div>
      <div class='block'>
        <p>功率因数</p>
        <h2>{{ basicInfo.elegong_a }}</h2>
      </div>
      <div class='block'>
        <p>月度报表</p>
        <h2>报告浏览</h2>
      </div>
      <div class='block'>
        <p>综合评分</p>
        <h2>20（一般）</h2>
      </div>
    </div>

    <!-- 运行状态-->
    <div class='status'>
      <div class='card'>
        <img src='../../../assets/index/icon1.png' alt=''>
        <div>
          <p>有功功率</p>
          <p>{{ basicInfo.elegong_a }}kw</p>
        </div>
      </div>
      <div class='card'>
        <img src='../../../assets/index/icon2.png' alt=''>
        <div>
          <p>无功功率</p>
          <p>{{ basicInfo.reactive_power }}kw</p>
        </div>
      </div>
      <div class='card'>
        <img src='../../../assets/index/icon3.png' alt=''>
        <div>
          <p>环境温度</p>
          <p>{{ basicInfo.RH }}℃</p>
        </div>
      </div>

      <div class='card'>
        <img src='../../../assets/index/icon4.png' alt=''>
        <div>
          <p>环境湿度</p>
          <p>{{ basicInfo.env_temp }}%</p>
        </div>
      </div>

    </div>

    <!-- 链接-->
    <div class='link'>
      <div>
        <img src='../../../assets/index/peidian.png' class='icon'>
        <span>配电图</span>
        <img src='../../../assets/index/jiantou.png' alt='' class='arrow'>
      </div>
      <div @click='handleLink("/realtimeControl/firefighting")'>
        <img src='../../../assets/index/jiankong.png' class='icon'>
        <span>视频</span>
        <img src='../../../assets/index/jiantou.png' alt='' class='arrow'>
      </div>
      <div @click='handleLink("/realtimeControl/electricityParameters")'>
        <img src='../../../assets/index/huilu.png' class='icon'>
        <span>配电回路</span>
        <img src='../../../assets/index/jiantou.png' alt='' class='arrow'>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'TotalData',
  props: ['basicInfo'],
  methods: {
    handleLink(url) {
      this.$router.push(url)
    },
  },
}
</script>

<style lang='scss' scoped>
.site {
  width: 100%;
  height: 67px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  justify-content: space-between;

  .block {
    width: 22%;
    height: 100%;
    position: relative;
    text-align: center;

    p, h2 {
      margin: 0;
    }

    p {
      margin-bottom: 10px;
      font-size: 18px;
      font-family: Source Han Sans CN;
      font-weight: 400;
      color: #A7B1CA;
    }

    h2 {
      font-size: 26px;
      font-family: DIN;
      font-weight: 700;
      color: #394565;
    }
  }

  .block:nth-child(1) {
    width: 15%;
  }

  .block:nth-child(2) {
    width: 20%;
  }

  .block:nth-child(3) {
  }

  .block:nth-child(4) {
    width: 20%;
  }

  .block:nth-child(5) {
    width: 18%;

  }

  .block::after {
    content: ' ';
    width: 2px;
    height: 49px;
    background: #E5E7EF;
    position: absolute;
    right: 0;
    top: 10px;
  }

  .block:nth-child(4)::after {
    content: ' ';
    width: 0;
    height: 0;
  }
}

.status {
  width: 100%;
  height: 160px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  //margin-top: 10px;

  .card {
    width: 266px;
    height: 160px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    box-sizing: border-box;
    padding: 54px 0 0 50px;

    img {
      width: 52px;
      height: 52px;
    }

    div {
      margin-left: 14px;
      margin-top: 4px;

      p {
        font-size: 14px;
        font-family: Source Han Sans CN;
        font-weight: 400;
        color: #FFFFFF;
        margin-top: 0;
        margin-bottom: 6px;
      }

      p:nth-child(2) {
        font-size: 20px;
        font-weight: bold;
      }
    }
  }

  .card:nth-child(1) {
    background: url("../../../assets/index/gonglv.png");
    background-size: 100% 100%;
  }

  .card:nth-child(2) {
    background: url("../../../assets/index/wu.png");
    background-size: 100% 100%;
  }

  .card:nth-child(3) {
    background: url("../../../assets/index/huangjing.png");
    background-size: 100% 100%;
  }

  .card:nth-child(4) {
    background: url("../../../assets/index/shudu.png");
    background-size: 100% 100%;
  }
}

.link {
  width: 100%;
  height: 65px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  padding: 0 15px;
  margin-top: 5px;
  cursor: pointer;

  div {
    width: 230px;
    height: 59px;
    background: #FFFFFF;
    box-shadow: 0px 0px 20px 0px rgba(1, 43, 82, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    padding: 0 28px;

    .icon {
      width: 38px;
      height: 38px;
    }

    .arrow {
      width: 11px;
      height: 11px;
    }

    span {
      font-size: 18px;
      font-family: Source Han Sans CN;
      font-weight: bold;
      color: #333333;

    }
  }
}

</style>
